import {request} from "@/utils/request";

import type {
    EditNursingProjectResult,
    NursingProjectDetailResult,
    NursingProjectPageResult
} from '../model/NursingProject'

//分页查询护理项目列表
export function searchProject(params) {
    return request.get<NursingProjectPageResult>({
        url: '/nursing/project',
        params
    })
}

// 新增护理项目
export function addNursingProject(data) {
    return request.post<EditNursingProjectResult>({
        url: '/nursing/project',
        data
    })
}

// 查询护理项目详情
export function getNursingProjectDetail(id) {
    return request.get<NursingProjectDetailResult>({
        url: `/nursing/project/${id}`
    })
}

//修改
export function editNursingProject(data) {
    return request.put<NursingProjectDetailResult>({
        url: '/nursing/project',
        data
    })
}

//禁用
// 启用禁用护理项目
export function updateNursingProjectStatus(id, status) {
    return request.put<EditNursingProjectResult>({
        url: `/nursing/project/${id}/status/${status}`
    })
}


//删除
export function deleteNursingProject(id) {
    return request.delete<EditNursingProjectResult>({
        url: `/nursing/project/${id}`
    })
}
